using System.Diagnostics;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Interactivity;
using Avalonia.Markup.Xaml;

namespace JMCOM.Components.EpsonRobot;

public partial class RobotView : UserControl
{
    public RobotView(IRegionManager regionManager)
    {
        InitializeComponent();
        this.Loaded  += LoadRegion;
        _regionManager = regionManager;

    }
    private readonly IRegionManager _regionManager;
    private void LoadRegion(object? sender, RoutedEventArgs e)
    {
        var currentRm = RegionManager.GetRegionManager(this) ?? RegionManager.GetRegionManager(this.FindControl<Control>("FlowGraphyHost"));
        currentRm.RequestNavigate("FlowGraphyView","NodesEditorView");
    }
}